package upb.webserver.test.param;

import com.upb.webserver.common.pojo.account.PasswordInfo;
import com.upb.webserver.common.pojo.account.developer.*;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

public class DeveloperParamUtils {
    private static Base64.Encoder encoder = Base64.getEncoder();


    /**
     * ReqDeveloperRegisterVO
     *
     * @return
     */
    public static ReqDeveloperRegisterVO initReqDeveloperRegisterVO() {
        ReqDeveloperRegisterVO obj = new ReqDeveloperRegisterVO();
        obj.setAccount("daMing7");
        obj.setPassword(encoder.encodeToString("Abcd1234".getBytes(StandardCharsets.UTF_8)));
        obj.setRealName("大明7");
        obj.setCompanyName("waHeiHei7");
        obj.setEmail("daMing71@163.com");
        obj.setMobile(15943342427L);
        obj.setAddress("广东深圳");

        return obj;
    }

    /**
     *
     * @return
     */
    public static ReqAddDeveloperVO initReqAddDeveloperVO() {
        ReqAddDeveloperVO obj = new ReqAddDeveloperVO();
        obj.setAccount("daMing7");
        obj.setPassword(encoder.encodeToString("Abcd1234".getBytes(StandardCharsets.UTF_8)));
        obj.setRealName("大明7");
        obj.setEmail("daMing71@163.com");
        obj.setMobile(15943342427L);
        obj.setAddress("广东深圳");

        //-------------------
        //----在管理台添加时填---
        //--------------------
        obj.setCompanyName("waHeiHei7");
        return obj;
    }



    /**
     * ReqModifyDeveloperVO
     *
     * @return
     */
    public static ReqModifyDeveloperVO initReqModifyDeveloperVO() {
        ReqModifyDeveloperVO obj = new ReqModifyDeveloperVO();
        obj.setRealName("大明7");
        obj.setCompanyName("waHeiHei88888");
        obj.setEmail("daMing7@163.com");
        obj.setMobile(15973342425L);
        obj.setAddress("广东深圳7");

        return obj;
    }


    /**
     * ReqAddContactPersonVO
     *
     * @return
     */
    public static ReqAddContactPersonVO initReqAddContactPersonVO() {
        ReqAddContactPersonVO obj = new ReqAddContactPersonVO();
        obj.setAccount("daMing5");
        obj.setPassword(encoder.encodeToString("123456".getBytes(StandardCharsets.UTF_8)));
        obj.setRealName("大明5");
        obj.setEmail("daMing5@163.com");
        obj.setMobile(15915332426L);
        obj.setAddress("广东广州");
        return obj;
    }


    /**
     * ReqFreezeVO
     *
     * @return
     */
    public static ReqFreezeVO initReqFreezeVO() {
        ReqFreezeVO param = new ReqFreezeVO();
        param.setDeveloperId(1);
        param.setDescription("test");
        return param;
    }

    /**
     * PasswordInfo
     *
     * @return
     */
    public static PasswordInfo initPasswordInfo() {
        PasswordInfo param = new PasswordInfo();
        param.setNewAccountPwd(encoder.encodeToString("1234561".getBytes(StandardCharsets.UTF_8)));
        param.setOldAccountPwd(encoder.encodeToString("123456".getBytes(StandardCharsets.UTF_8)));
        return param;
    }

}
